package com.changgou.goods.api;


import com.changgou.common.entity.Result;
import com.changgou.goods.pojo.Category;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

@Api(value = "分类管理接口",description = "分类管理接口,提供页面的增丶删丶改丶查")
public interface CategoryApi {

    /**
     * 查询全部数据
      */
    @ApiOperation("查询所有分类信息")
    public Result findAll();

    /**
     * 根据id查询
     * @param id
     * @return
     */
    @ApiOperation("根据ID查询分类信息")
    @ApiImplicitParams({@ApiImplicitParam(name = "id",value = "分类ID",required = true,paramType = "path",dataType = "int"),})
    public Result findById(@PathVariable Integer id);


    /**
     * 新增数据
     * @param category
     * @return
     */
    @ApiOperation("新增分类")
    public Result add(Category category);

    /**
     * 修改数据
     * @param category
     * @param id
     * @return
     */

    @ApiOperation("根据id修改数据")
    @ApiImplicitParams({@ApiImplicitParam(name = "id",value = "分类ID",required = true,paramType = "path",dataTypeClass = Integer.class),})
    public Result update( Category category,Integer id);


    /**
     * 根据id删除品牌
     * @param id
     * @return
     */
    @ApiOperation("根据ID删除品牌")
    @ApiImplicitParams({@ApiImplicitParam(name = "id",value = "分类ID",required = true,paramType = "path",dataType = "int")})
    public Result delete( Integer id);


    /**
     * 多条件搜索分类数据
     * @param searchMap
     * @return
     */
    @ApiOperation("查询分类列表")
    public Result findList( Map searchMap);


    /**
     * 分页搜索实现
     * @param searchMap
     * @param page
     * @param size
     * @return
     */
    @ApiOperation("条件查询分类列表")
    @ApiImplicitParams({@ApiImplicitParam(name = "searchMap",value = "条件查询 JONS数据, 分类条件查询"),
            @ApiImplicitParam(name="page",value = "页码",required=true,paramType="path",dataType="int"),
            @ApiImplicitParam(name="size",value = "每页记录数",required=true,paramType="path",dataType="int")
    })
    public Result findPage( Map searchMap,  int page,  int size);



}
